<!--
 * @页面名称:singalr专用modal
 * @描述: 
 * @作者: 
 * @Date:
-->
<template>
  <div>
    <el-dialog
      :modelValue="visible"
      :width="width"
      :draggable="draggable"
      :show-close="false"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      center
    >
      <slot></slot>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="cease">{{ discontinueFont }}</el-button>
          <el-button type="danger" @click="cancel">取消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
const props = defineProps({
  visible: {
    type: Boolean,
    default: false
  },
  draggable: {
    type: Boolean,
    default: true
  },
  title: {
    type: String,
    default: ""
  },
  width: {
    type: String,
    default: "450"
  },
  height: {
    type: String,
    default: "450"
  },
  discontinueFont: {
    type: String,
    default: "中止"
  }
});

const emit = defineEmits(["update:visible", "cease", "cancel"]);
// 取消事件
const cancel = () => {
  // emit("update:visible", false);
  emit("cancel");
};
// 确认事件
const cease = () => {
  emit("cease");
};
</script>

<style lang="scss" scoped>
// :deep(.el-dialog__body) {
//   max-height: 500px;
//   overflow: scroll;
//   // padding: 15px 15px 0 15px;
// }
:deep(.el-dialog__footer) {
  border-top: 1px solid var(--el-border-color-lighter);
}
</style>
